﻿using JUtil;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UpdatePanel_demoUpdatePanel : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Label1.Text = DateTime.Now.ToString();
        Label2.Text = DateTime.Now.ToString();
        Label3.Text = DateTime.Now.ToString();

        Label4.Text = DateTime.Now.ToString();
        Label5.Text = DateTime.Now.ToString();
        Label6.Text = DateTime.Now.ToString();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
    }
    protected void Button5_Click(object sender, EventArgs e)
    {
    }
    protected void Button6_Click(object sender, EventArgs e)
    {
    }

    private void Page_Error(object sender, System.EventArgs e)
    {
        // --------------------------------------------------
        // 對於尚未捕捉到的Exception，可知道那個Function引起的，記得
        // 在那個函式加上try-catch-block
        // --------------------------------------------------
        Exception ex = Server.GetLastError();

        Log.ReportError(ex);
        //Response.Write("Handled error from Page<br>");

        // 記得要清除錯誤
        Server.ClearError();
    }

    protected void ScriptManager1_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e)
    {
        // --------------------------------------------------
        // 對於Updatepanel中尚未捕捉到的Exception，可知道那個Function引起的，記得
        // 在那個函式加上try-catch-block
        // --------------------------------------------------

        //if (e.Exception.Data["ExtraInfo"] != null)
        //{
        //    ScriptManager1.AsyncPostBackErrorMessage =
        //        e.Exception.Message +
        //        e.Exception.Data["ExtraInfo"].ToString();
        //}
        //else
        //{
        //    ScriptManager1.AsyncPostBackErrorMessage = e.Exception.Message;
        //        //"An unspecified error occurred.";
        //}
    }
}
